package cn.qg.auth.service.qguser;

import cn.qg.beans.pojo.QgUser;
import cn.qg.mapper.qguser.QgUserMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @auth amwdx
 * 2019/5/11 0011 16:45
 */
@Service
public class QgUserServiceImpl implements QgUserService {
    @Resource
    private QgUserMapper qgUserMapper;

    @Override
    public QgUser login(String phone, String password) throws Exception{
        // 根据phone 查询用户信息
        QgUser qgUser=qgUserMapper.getQgUserByPhone(phone);
        if (qgUser!=null){
            if (!qgUser.getPassword().equals(password)){
                return null;
            }else{
                return qgUser;
            }
        }else{
            return null;
        }
    }
}
